# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.Cluster do
  @moduledoc """
  A resizable group of nodes in a particular cloud location, capable of serving all Tables in the parent Instance.

  ## Attributes

  *   `clusterConfig` (*type:* `GoogleApi.BigtableAdmin.V2.Model.ClusterConfig.t`, *default:* `nil`) - Configuration for this cluster.
  *   `defaultStorageType` (*type:* `String.t`, *default:* `nil`) - Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
  *   `encryptionConfig` (*type:* `GoogleApi.BigtableAdmin.V2.Model.EncryptionConfig.t`, *default:* `nil`) - Immutable. The encryption configuration for CMEK-protected clusters.
  *   `location` (*type:* `String.t`, *default:* `nil`) - Immutable. The location where this cluster's nodes and storage reside. For best performance, clients should be located as close as possible to this cluster. Currently only zones are supported, so values should be of the form `projects/{project}/locations/{zone}`.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
  *   `nodeScalingFactor` (*type:* `String.t`, *default:* `nil`) - Immutable. The node scaling factor of this cluster.
  *   `serveNodes` (*type:* `integer()`, *default:* `nil`) - The number of nodes in the cluster. If no value is set, Cloud Bigtable automatically allocates nodes based on your data footprint and optimized for 50% storage utilization.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the cluster.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clusterConfig => GoogleApi.BigtableAdmin.V2.Model.ClusterConfig.t() | nil,
          :defaultStorageType => String.t() | nil,
          :encryptionConfig => GoogleApi.BigtableAdmin.V2.Model.EncryptionConfig.t() | nil,
          :location => String.t() | nil,
          :name => String.t() | nil,
          :nodeScalingFactor => String.t() | nil,
          :serveNodes => integer() | nil,
          :state => String.t() | nil
        }

  field(:clusterConfig, as: GoogleApi.BigtableAdmin.V2.Model.ClusterConfig)
  field(:defaultStorageType)
  field(:encryptionConfig, as: GoogleApi.BigtableAdmin.V2.Model.EncryptionConfig)
  field(:location)
  field(:name)
  field(:nodeScalingFactor)
  field(:serveNodes)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.Cluster do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.Cluster.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.Cluster do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
